def hashjoin(table_s, table_r, joinAttrs):
    ts = table_s
    tr = table_r
    
    result = {}
    
    for s in ts:
        h = ""
        for j in joinAttrs:
            h += "_" + str(s[j[0]])
        if hash(h) in result.keys():
            result[ hash(h) ] += [s]
        else:
            result[ hash(h) ] = [s]
    
    final = []
    for r in tr:
        h = ""
        for j in joinAttrs:
            h += "_" + str(r[j[1]])
        if hash(h) in result.keys():
            ls = result[(hash(h))]
            for l in ls:
                final += [[l,r]]
    
    return final
        
def custoHashJoin(table_s, table_r):
    pass   
        